aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/send/bitcoin/[address]/+layout.server.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/routes/(app)/send/bitcoin/[address]/+layout.server.ts')
-rw-r--r--src/routes/(app)/send/bitcoin/[address]/+layout.server.ts11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/routes/(app)/send/bitcoin/[address]/+layout.server.ts b/src/routes/(app)/send/bitcoin/[address]/+layout.server.ts
index d8df1986..6acb36b6 100644
--- a/src/routes/(app)/send/bitcoin/[address]/+layout.server.ts
+++ b/src/routes/(app)/send/bitcoin/[address]/+layout.server.ts
@@ -15,10 +15,13 @@ export async function load({ cookies, params, parent }) {
}
if (invoice) {
- const recipient = await get(`/users/${invoice.uid}`);
- let r = `/pay/${recipient.username}`;
- if (amount) r += `/${amount}`;
- if (recipient?.id !== user.id) redirect(307, r);
+ const isVault = invoice.account?.pubkey || invoice.account?.seed;
+ if (isVault) {
+ // Vault account — stay on /send/bitcoin for on-chain send
+ } else {
+ // Custodial account — send internally via the original invoice
+ if (invoice.uid !== user.id) redirect(307, `/send/invoice/${invoice.id}`);
+ }
}
return { balance };